package com.letoy.study.utils;

public class Constants {

    //激活码不存在
    public static final int CODE_NOT_EXIST = 3;

    //邮箱已经被使用
    public static final int EMAIL_ALREADY_USE = 4;
    //激活码超时
    public static final int CODE_TIME_INVALID = 5;
    //激活码错误
    public static final int CODE_INVALID = 6;
    //账号或者密码错误
    public static final int PASSWORD_INCORRECT = 7;

    //预期外的错误
    public static final int EXCEPTED_SYSTEM_ERROR = 8;

    //一般指数据库的操作，或者正常操作中出现的异常
    public static final int SYSTEM_ERROR = 10;

    //操作返回失败
    public static final int FAIL = 10;

    //发送邮件系统异常
    public static final int SYSTEM_ERROR_MAIL_SEND_FAIL = 11;

    //用户不合法
    public static final int SYSTEM_ERROR_USER_INVALID = 12;

    //用户权限不够
    public static final int SYSTEM_ERROR_USER_LEVEL_INVALID = 13;

    //用户尚未激活
    public static final int SYSTEM_ERROR_USER_NOT_ACTIVATE = 14;

    public static final int SUCCESS = 0;


    public static String getMsg(int ERROR_CODE) {
        String msg = "";
        switch (ERROR_CODE) {
            case SYSTEM_ERROR_USER_LEVEL_INVALID:
                return "INSUFFICIENT USER ACCESS";
            case SYSTEM_ERROR_USER_NOT_ACTIVATE:
                return "USER NOT ACTIVATED";
            case SYSTEM_ERROR_USER_INVALID:
                return "USER NOT LOGIN";
            case SYSTEM_ERROR:
                return "PLEASE TRY AGAIN";
            case CODE_TIME_INVALID:
                return "激活码失效";
            case CODE_INVALID:
                return "CODE ERROR";
            case PASSWORD_INCORRECT:
                return "PASSWORD INCORRECT";
            case CODE_NOT_EXIST:
                return "激活码不存在";
            case EXCEPTED_SYSTEM_ERROR:
                return "系统错误请稍后再试";
        }
        return msg;
    }


}
